<%-- 
    Document   : administration.jsp
    Created on : 23 déc. 2013, 19:24:56
    Author     : root
--%>

<%@page import="presenter.Presenter"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% HttpSession thisSession = (HttpSession) request.getAttribute("thisSession");
    String demande = "";
    String msgFile = "";
    Map<String, String> waitingFile = (HashMap<String, String>) request.getAttribute("waitingFile");
    if (waitingFile.size() > 0) {
        msgFile = msgFile + "(" + waitingFile.size() + ")";

    }
    ArrayList<String> demandeContact = (ArrayList<String>) thisSession.getAttribute("demandeContact");
    if (demandeContact.size() != 0) {
        boolean accept = true;
        int notif = demandeContact.size();
        if (notif != 0) {
            demande = " (" + notif + ")";
        }
    }
    ArrayList<String> newMessage = (ArrayList<String>) thisSession.getAttribute("newMessage");
    String newMsg = "";
    if (newMessage.size() != 0) {
        newMsg = newMsg + " (" + newMessage.size() + ")";
    }
%>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="css/administrator.css"/>
        <title>MISS Administrator Page</title>
    </head>
    <body>
        <header>
            <a href="RedirectConnected"><img src="Pictures/logo.png" class="logo" style="float: outside;"></a>
            <div class="zone">
                <div class="zone-right"></div>
                <div class="zone-left"></div>
                <div class="zone-bg">
                    <ul>
                        <li><a href="RedirectConnected"><span>Home <%= newMsg%></span></a></li>
                        <li><a href="NewContact.html"><span>Contact <%= demande%></span></a></li>
                        <li><a href="profile.html"><span>Profile</span></a></li>
                        <li><a href="File.html"><span>File <%= msgFile%></span></a></li>
                        <li class="current"><a href="Administrator.html"><span>Administration</span></a></li>
                        <li><a href="logout.html"><span>Logout</span></a></li>
                    </ul>
                </div>
            </div>
        </header>
        <div class="edit">
            <h3><img src="Pictures/edit.png" id="imgedit"> Edit</h3>
            <div class="actions" id="account">
                <TABLE BORDER="1"> 
                    <TR> 
                    <div class="actions" id="create">
                        <TD> <a href="createaccount.html"><img id="plus" src="Pictures/plus.png"></a> </TH> 
                        <TD nowrap> Create account </TH> 
                        <TD>  <img id="arrow" src="Pictures/arrow.png"> </TH>  
                            </TR> 
                            </TABLE> 
                    </div>

                    <div class="actions" id="find">
                        <TABLE BORDER="1"> 
                            <TR> 
                            <div class="actions" id="create">
                                <TD>  <a href="findaccount.html"><img id="search" src="Pictures/search.png"></a></TD> 
                                <TD nowrap> Find account </TD> 
                                <TD>  <img id="arrow" src="Pictures/arrow.png"> </TD>  
                                </TR> 
                        </TABLE>
                    </div>
            </div>

            <div class="report">
                <div class="statistics" id="stats">
                    <h3><img src="Pictures/stats.png" id="imgstats"> Statistics</h3>
                    <TABLE BORDER=0> 
                        <TR> 
                            <td> Connections Number : </td> <td> <%=Presenter.getNbConnections()%> </td>
                        </tr><tr>
                            <td> Profiles Number : </td> <td> <%=Presenter.getNbProfiles()%></td>
                        </tr><tr>
                            <td>Messages Number : </td> <td> <%=Presenter.getNbMessages()%></td>
                        </tr><tr>
                            <td>Files Number :</td> <td> <%=Presenter.getNbFiles()%></td>
                        </tr>
                    </TABLE>
                    <div>
                        <br>
                    </div>
                </div>
            </div>
    </body>
</html>
